using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;

namespace GameLibrary
{
    public class Tank
    {
        Texture2D texture;
        Vector2 position;

        float speed;

        public Tank(Texture2D _texture, Vector2 _position)
        {
            texture = _texture;
            position = _position;
            speed = 0.15f;
        }

        public void Update(GameTime gameTime)
        {
            KeyboardState keyboard = Keyboard.GetState();

            if (keyboard.IsKeyDown(Keys.A))
            {
                position.X -= 1 * gameTime.ElapsedGameTime.Milliseconds * speed;
            }
            if (keyboard.IsKeyDown(Keys.D))
            {
                position.X += 1 * gameTime.ElapsedGameTime.Milliseconds * speed;
            }
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        }

    }
}
